package tools;

import java.util.ArrayList;
import java.util.List;

import datatypes.Edge;
import datatypes.Vertex;

/**
 * Test LMT triangulation by applying Vertex orderings
 * 
 * Note: this code is still under construction
 * 
 * @author ltune
 *
 */
public class DepthFirstSearch {
	
	/**
	 * Conttructor for DFS-check pass graph as V and E lists 
	 * 
	 * */
	public DepthFirstSearch(List<Vertex> pointList, List<Edge> edgesArray) {
		super();
		this.pointList = pointList;
		this.edgesArray = edgesArray;
	}


	/* member variables for DFS search */
	private boolean reordered;
	private List<Vertex> pointList; // represents the grpaghs' points
	private List<Edge> edgesArray; // represents the graphs' edges
	
	/* end DFS variables */

	/* getters and setters */

	public boolean isReordered() {
		return reordered;
	}

	public void setReordered(boolean reordered) {
		this.reordered = reordered;
	}

	public List<Vertex> getPointList() {
		return pointList;
	}

	public void setPointList(List<Vertex> pointList) {
		this.pointList = pointList;
	}

	public List<Edge> getEdgesArray() {
		return edgesArray;
	}

	public void setEdgesArray(List<Edge> edgesArray) {
		this.edgesArray = edgesArray;
	}

	/* end gettes and setters */
	
	/**
	 * This is the DFS' heart, note it is not yet ready.
	 * 
	 */
	public List<Vertex> search(){
		List<Vertex> traversed=new ArrayList<Vertex>();
		// TODO traverse graph and apply reodering if necessary
		return traversed;
	}
	
	/**
	 * Reorder graph when necessary.
	 * Set member reordered: true
	 */
	protected void reorder(){
		// TODO reoder the edges
		setReordered(true);
	}
}
